import { Injectable, Inject } from '@nestjs/common';

@Injectable()
export class JwtBlacklistService {
  private blacklist: string[] = [];

  async addToBlacklist(token: string): Promise<void> {
    token && this.blacklist.push(token);
    console.log(this.blacklist, 'this.blacklistthis.blacklist', token);
  }

  isTokenRevoked(token: string): boolean {
    console.log(
      this.blacklist.includes(token),
      '=this.blacklist.includes(token)',
    );
    return this.blacklist.includes(token);
  }
}
